package leecode

func getIntersectionNode160(headA, headB *ListNode) *ListNode {
	hashMap := make(map[*ListNode]int)
	for i := headA; i != nil; i = i.Next {
		hashMap[i] = i.Val
	}
	for i := headB; i != nil; i = i.Next {
		if _, ok := hashMap[i]; ok {
			return i
		}
	}
	return nil
}
